DRAKHYSYS INFINITY TILESET WORKBENCH V4.8.8.4
CREATURE FACTORY MODULE

BASE
----
Built on the user's working V4.8.8.3 package.
The existing map export, WED/TIS/PVRZ/MOS/BMP, reciprocal exit/entrance, ARE properties,
actor placement, UI editor and compiler source files are unchanged except that
`tileset_workbench.py` imports and exposes the new modular Creature Factory tab and updates
its displayed version title.

NEW MODULE FILES
----------------
- creature_factory.py
- creature_factory_core.py
- START_CREATURE_FACTORY.bat
- test_creature_factory.py
- RUN_CREATURE_FACTORY_SELF_TEST.bat

WHAT IT DOES
------------
1. Reads CHITIN.KEY and lists CRE resources registered in the game's BIF archives.
2. Extracts a selected CRE V1.0 without modifying the original BIF.
3. Clones it to new unique <=8-character creature resource names.
4. Appearance modes:
   - Keep original appearance.
   - Random colours sampled from colour indexes already used by existing CRE files.
   - Copy one chosen CRE's animation + colours as a fixed appearance donor.
5. Visible-name modes:
   - Random generated fantasy names.
   - Keep original TLK name.
   - One custom base name (numbered when generating a batch).
6. For new names, appends strings to a COPY of dialog.tlk, preserving the original file.
   Optional matching dialogf.tlk can be updated at identical strrefs.
7. Assigns an editable <=8-character Override AI script resref to every generated CRE.
8. Writes a shared editable BAF base source (default DRAKBASE.BAF).
9. Writes JSON and CSV manifests describing every generated CRE.

OUTPUT LAYOUT
-------------
<chosen output>/
  CRE/      generated *.CRE
  BAF/      base AI *.BAF
  TLK/      patched dialog.tlk / optional dialogf.tlk copies
  DRAKHYSYS_CREATURE_FACTORY_MANIFEST.json
  DRAKHYSYS_CREATURE_FACTORY_MANIFEST.csv

IMPORTANT TLK SAFETY
--------------------
The factory NEVER overwrites the source dialog.tlk/dialogf.tlk. It creates patched copies in
its output folder. Install those copies only after keeping a backup of the active language TLK.
If both dialog.tlk and dialogf.tlk are supplied, their starting string counts must match.

SCRIPT NOTE
-----------
The factory writes BAF source and assigns that script resref to the CRE Override slot.
Use the existing BAF/BS/BCS compiler to compile the generated BAF to a BCS with the same resref.
This keeps the AI source easy to edit together with ChatGPT instead of hiding the behavior in a
binary-only script.

RESOURCE NOTE
-------------
Generated CRE resource names stay within the Infinity Engine 8-byte ResRef limit. The factory
checks the loaded KEY resource list and avoids existing CRE resrefs.
